package io高级流or处理流;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fil = new FileInputStream("./src/高级流or处理流/qwe.obj");
        ObjectInputStream ois = new ObjectInputStream(fil);
/**序列化的是学生对象，那反序列的也一定要是对应类型的对象*/
//        Object o = ois.readObject();
//       Student s1=(Student)ois.readObject();
        Student student = (Student) ois.readObject();
        System.out.println(student);
        ois.close();
    }
}
